package com.zhuang.chapter04;

public class CircleMain {

	public static void main(String[] args) {
		Circle circle1 = new Circle(10);
		Circle circle2 = new Circle();
		circle2.setRadius(5);
		circle1.countArea();
		circle2.countArea();
	}

}

class Circle {
	private int radius;

	public Circle(int radius) {
		super();
		this.radius = radius;
	}

	public Circle() {
		super();
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}

	public void countCircumference() {
		System.out.println("圆形周长为-->" + radius * Math.PI * 2);
	}

	public void countArea() {
		System.out.println("圆形面积为-->" + Math.PI * Math.pow(radius, 2));
	}

}